package demo

import (
	"net/http"

	"github.com/gin-gonic/gin"
)

type Demo1Controller struct{}

func (c *Demo1Controller) Register(r gin.IRouter) {

	/*建立类似java 样例的路由1
	    PostMapping("/products/:id", getProduct)
		func getProduct(){

		}
	*/
	r.GET("/demo1/hello", c.hello)
}

func (c *Demo1Controller) hello(ctx *gin.Context) {
	ctx.String(http.StatusOK, "demo1 Hello World!")
}
